package com.example.animations.activities;

import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.example.animations.R;
import java.util.stream.IntStream;

public class LongListActivity extends AppCompatActivity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_long_list);

        String[] items = IntStream.range(0, 200)
                .mapToObj(i -> String.format("This is %s item", i))
                .toArray(String[]::new);

        ListView listView = findViewById(R.id.long_list);
        listView.setAdapter(new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, items));
    }
}
